PROGRAM MAPS
USE POLYMORPHIC_COMPLEXTAYLOR
TYPE(DAMAP) ROT,SEXT,TOTAL_DA_MAP
TYPE(DAMAP) da_map_2
REAL(DP) ANGLE,KICK_STRENGTH
TYPE(REAL_8) Y,X1,X2
integer mf
mf=20
open(unit=mf,file='results.txt')
CALL INIT(NO1=2,ND1=1,NP1=0,NDPT1 =0)     !   <------------------ init for maps in ND1 degrees of freedom

CALL ALLOC(ROT,SEXT,TOTAL_DA_MAP,da_map_2)
CALL ALLOC(Y,X1,X2)

ANGLE=30.0_DP * PI/180.0_DP



Y=ANGLE 



ROT%V(1)= (COS(ANGLE).MONO.'10') + (SIN(ANGLE).MONO.'01') -1.d-1
ROT%V(2)= (COS(ANGLE).MONO.'01') - (SIN(ANGLE).MONO.'10') -2.d-1

KICK_STRENGTH=3.0_DP

SEXT%V(1)= (1.0_DP.MONO.'10') +.01d0
SEXT%V(2)= (1.0_DP.MONO.'01') + (KICK_STRENGTH.MONO.'20') +.02d0


TOTAL_DA_MAP=SEXT*ROT   ! <---- * PERFORMS A DA-CONCATENATION OF TWO DAMAPS

write(mf,*) "    "
write(mf,*) " ############################  DA POWER **  ############################  "
write(mf,*) "    "

write(mf,*) " TOTAL_DA_MAP "
call print(TOTAL_DA_MAP,mf)

da_map_2=TOTAL_DA_MAP*TOTAL_DA_MAP

write(mf,*) " da_map_2=TOTAL_DA_MAP*TOTAL_DA_MAP "
call print(da_map_2,mf)

da_map_2=TOTAL_DA_MAP**2

write(mf,*) " da_map_2=TOTAL_DA_MAP**2 "
call print(da_map_2,mf)

da_map_2=TOTAL_DA_MAP**(-2)

write(mf,*) "Inverse of the square of the damap: da_map_2= TOTAL_DA_MAP**(-2) "
write(mf,*) "Inverse operator wipes out the constant part "
call print(da_map_2,mf)


da_map_2=da_map_2*TOTAL_DA_MAP*TOTAL_DA_MAP

write(mf,*) "Checking above result : TOTAL_DA_MAP*TOTAL_DA_MAP*TOTAL_DA_MAP**(-2) =  identity ? "
call print(da_map_2,mf)

close(20)






CALL KILL(ROT,SEXT,TOTAL_DA_MAP,da_map_2)
CALL KILL(Y,X1,X2)



END PROGRAM MAPS

